//导入我们sendEmail.js文件中导出的东西
const sendEmail = require('./sendEmail.js')

//此时sendEmail是一个函数，可传参数有 email, code , 执行完会返回一个status, 用于判断是否发送成功


exports.getEmail = function () {
    return (req,res) => {
        let code = Math.floor(Math.random() * 900000) + 100000;
        const result = sendEmail('2310023078@qq.com', code);
        console.log(result);
        result.then(()=>{
            console.log("发送成功");
            res.send(code + "");
        })
        
    }
   
}